wayland: fix filechooser crash
authorMatthias Clasen <mclasen@redhat.com>
Wed, 23 Aug 2017 14:27:43 +0000 (10:27 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 23 Aug 2017 14:36:30 +0000 (10:36 -0400)
The size of the window can be updated before we're requested its
creation on the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=786673

gdk/wayland/gdkwindow-wayland.c

index 8af96e1bcc06170f265fbf075200cff0b35eb73e..1b015346bcb71ef121675e4662748cfa70a0e219 100644 (file)
@@ -331,13 +331,9 @@ gdk_wayland_window_update_size (GdkWindow *window,
   impl->scale = scale;
 
   if (impl->display_server.egl_window)
-    {
-      wl_egl_window_resize (impl->display_server.egl_window,
-                            width * scale,
-                            height * scale,
-                            0, 0);
-    }
-  wl_surface_set_buffer_scale (impl->display_server.wl_surface, scale);
+    wl_egl_window_resize (impl->display_server.egl_window, width * scale, height * scale, 0, 0);
+  if (impl->display_server.wl_surface)
+    wl_surface_set_buffer_scale (impl->display_server.wl_surface, scale);
 
   area.x = 0;
   area.y = 0;